/**
 * Copyright (c) 2015 www.smarthome.com All rights reserved. <br />
 * 本软件源代码版权归xxxx公司,未经许可不得任意复制与传播.<br />
 *
 */
package com.smarthome.domain.enums;

import java.io.Serializable;


/**
 *
 *CertStatus 账户认证状态的枚举类
 *
 * @author KongXiangyu
 *
 * @since 1.0
 */
    
public enum CertStatus implements Serializable
{
	UNCERTIFIED(1, "未认证"),
	CERTIFIED(2, "已认证"),
    IN_CERTIFIED(3, "认证中");
	
	private int type;//类型
	private String certStatus;//认证状态
	
	private CertStatus(int type, String certStatus)
	{
		this.type = type;
		this.certStatus = certStatus;
	}

	public int getType()
	{
		return type;
	}

	public String getCertStatus()
	{
		return certStatus;
	}

	
	/**
	 * 根据认证类型获取枚举类
	 * @param type
	 * @return
	 */
	    
	public static CertStatus getByType(int type)
	{
		 for(CertStatus certStatus : values()) {
	            if(certStatus.getType() == type) {
	                return certStatus;
	            }
	        }
	        throw new IllegalArgumentException("none-defined certStatus type,type:" + type);
	}
}
